/*
 * SearchAction.h
 *
 *  Created on: 13/mag/2014
 *      Author: va2013
 */

#ifndef SearchAction_H_
#define SearchAction_H_
#include <Aria.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv/cv.h>
#include <opencv/highgui.h>

using namespace std;
using namespace cv;

class SearchAction: public ArAction {
private:
	int rotVelocity;
	int direction;
	ArActionDesired myDesired;

	ArRobot* robot;
	bool init, first;
	double startHeading;
	double turningTime;
	double startTime;
	int decel, currentDirection;

	double getAngleFromHeading(double currentHeading, double lastHeading,
			int direction);

public:
	SearchAction(ArRobot* robot, int direction, int rotVelocity,
			double turningTime);
	virtual ~SearchAction();
	ArActionDesired* fire(ArActionDesired currentDesired);
	void restart(int direction);
};

#endif /* SearchAction_H_ */
